package com.sanery.service.impl;

import org.apache.ibatis.session.SqlSession;

import com.sanery.dao.MyBatisUtil;
import com.sanery.dao.UserDao;
import com.sanery.service.UserService;

public class UserServiceImpl implements UserService {

	SqlSession session = MyBatisUtil.getSession();
	private UserDao dao = session.getMapper(UserDao.class);

	@Override
	public Integer getUserId(String username, String password) {
		Integer id = dao.getUserId(username, password);
		session.commit();// 提交事务
		MyBatisUtil.closeSession();
		return id;
	}
}
